
	<h1><?php echo $this->lang->line('video_title'); ?></h1>
	<form action="<?php echo admin_url();?>/video" method="post" >
	    <div class="toppage">
	    	<span class="left">
	        	<select style="width: 130px;" id="action">
	            	<option value=""><?php echo $this->lang->line('choose_action'); ?></option>                               
	                <option value="active"><?php echo $this->lang->line('active'); ?></option>
	                <option value="suspend"><?php echo $this->lang->line('suspend'); ?></option>
	            </select>
	            <input onclick="$('[name=action]').val($('#action').val()); $('#action_video_form').submit()" value="<?php echo $this->lang->line('apply'); ?>" class="btn" type="button">
	            <input type="text" id="date" name="date" value="<?php echo ($date)?$date:"Date/time"; ?>" style="width:165px; padding:3px;" class="two" />
	       		<input type="text" name="search" onfocus="if (this.value == 'Keyword') {this.value = '';}" onblur="if (this.value == '') {this.value = 'Keyword';}"  value="<?php echo ($keyword)?$keyword:"Keyword" ; ?>" style="width:165px; padding:3px;" />
	        	<input type="submit" name="" value="<?php echo $this->lang->line('filter'); ?>" onclick="sendData()" class="btn" />
	        </span>
	       
	        <span class="btnadd">
	        	<a onclick="open_form('<?php echo admin_url(); ?>/add-new-video')" href="javascript:void(0)"><?php echo $this->lang->line('add'); ?></a>
	        </span>
	    </div>
    </form>
     <form action="<?php echo admin_url();?>/video/" method="post" id="list-video-form">
	     <div class="topart">
	    	<span class="left">
	    		<?php 
	    			$total_amount	=	$this->video_model->count_all();
	    			$active			=	$this->video_model->count_active();
	    		?>
	    		<font class="number">(<?php echo $total_amount;?>)</font>
	    		<a href="javascript:void(0);" onclick="sendData('all')"><?php echo $this->lang->line('all'); ?></a><font class="line">|</font>
	    		<font class="number">(<?php echo $active;?>)</font>
	    		<a href="javascript:void(0);" onclick="sendData('active')"><font color="#0b9901"><?php echo $this->lang->line('active'); ?></font></a>
	    		<font class="line">|</font><font class="number">(<?php echo $total_amount - $active;?>)</font>
	    		<a href="javascript:void(0);" onclick="sendData('pending')"><font color="#c60001"><?php echo $this->lang->line('pending'); ?></font></a>
	        </span>
	        <span class="right1">
	        	<select style="width:50px;" name="perpage" id="perpage" onchange="changePageNumber()">
	            	<option value="6" <?php echo ($current_perpage==6)?'selected':'';?>>6</option>
	                <option value="12" <?php echo ($current_perpage==12)?'selected':'';?>>12</option>
	                <option value="24" <?php echo ($current_perpage==24)?'selected':'';?>>24</option>
	                <option value="all" <?php echo ($current_perpage=='all')?'selected':'';?>><?php echo $this->lang->line('all'); ?></option>
	            </select>
	            <div class="pagination">
	                <?php if(isset($pagination)){echo $pagination;}?>
	            </div>
		    </span>
	    </div>
    </form>
    <div class="tableout">
    	<form action="<?php echo admin_url();?>/video/do-action" method="post" id="action_video_form">
			<div class="title1">
	        	<div class="column" style="width: 2%;"><input class="check_all" onclick="check_all('.check_all')" type="checkbox"></div>
	            <div class="column" style="width: 4%;"><?php echo $this->lang->line('number'); ?></div>
	            <div class="column" style="width: 25%;"><?php echo $this->lang->line('name'); ?></div>
	            <div class="column" style="width: 15%;"><?php echo $this->lang->line('thumbnail'); ?></div>
	            <div class="column" style="width: 25%;"><?php echo $this->lang->line('description'); ?></div>
	            <div class="column" style="width: 15%;"><?php echo $this->lang->line('date'); ?></div>
	            <div class="column" style="width: 8%;"><?php echo $this->lang->line('order'); ?></div>
	            <div class="column" style="width: 5%;"><?php echo $this->lang->line('status'); ?></div>
	        </div>
	        <?php if(count($slide_list[0])>0){?>
	        <?php foreach ($slide_list as $k => $v){?>
	        <div class="linecate2">
	        	<div class="column" style="width: 2%;"><input name="id[]" value="<?php echo $v->id;?>" type="checkbox" /></div>
	            <div class="column" style="width:4%;"><?php echo $k+1;?></div>
	            
	            <div id="row_<?php echo $v->id;?>">
		            <div class="column" style="width:25%;" onmouseover="Hovercat('<?php echo $v->id;?>')" onmouseout="Outcat('<?php echo $v->id;?>')">
		            	<a href="javascript:;" class="art ">
		            		<?php 
    							$content = $v->name;
		            			$content = strip_tags($content);
		            			if(strlen($content) > 40){
		            				$content = substr($content,0,40);
		            				$posw=strrpos($content," ");
		            				if($posw > 0)$content = substr($content,0,$posw);
		            				echo $content.'...';
		            			}else {
		            				echo $content;
		            			}
		            		?>
		            	</a><br />
		                <div class="action" id="neocat-<?php echo $v->id;?>">
		                    <img src="<?php echo base_url();?>public/admin/img/edit.gif" /><a href="javascript:void(0)" onclick="open_form('<?php echo admin_url(); ?>/edit-video/<?php echo $v->id;?>')"><?php echo $this->lang->line('edit'); ?></a>|<img src="<?php echo base_url();?>public/admin/img/delete.gif" /><a href="<?php echo admin_url();?>/delete-video/<?php echo $v->id;?>" onclick="return confirm('<?php echo $this->lang->line('delete_conf'); ?>');"><font color="#be0000"><?php echo $this->lang->line('delete'); ?></font></a>
		                </div>
		            </div>
		            <div class="column small_thumb " style="width:15%; padding: 5px 0px 0px 0px;">
		            	<img src="<?php if(file_exists($v->image_url)){echo base_url().$v->image_url;}else{echo img_link('no_image.gif','admin');}?>"  height="35"  />
	            		<div class="fullsize_thumb">
							<img  src="<?php if(file_exists($v->image_url)){echo base_url().$v->image_url;}else{echo img_link('no_image.gif','admin');}?>"  style="border:0px; width: 150px;"  alt="" title=""/>
						</div>
		            </div>
		            <div class="column" style="width:25%;">
		            	<span style="color: green;">
		            		<?php 
		            			$content = $v->description;
		            			$content = strip_tags($content);
		            			if(strlen($content) > 80){
		            				$content = substr($content,0,80);
		            				$posw=strrpos($content," ");
		            				if($posw > 0)$content = substr($content,0,$posw);
		            				echo $content.'...';
		            			}else {
		            				echo $content;
		            			}
		            		?>
	            		</span>
		            </div>
		            <div class="column" style="width:15%;">
		            	<span><?php echo $v->date_create;?></span>
		            </div>
		            <div class="column" style="width:8%;">
		            	<input type="text" name="order" class="order" id="<?php echo $v->id;?>" value="<?php echo $v->order;?>" maxlength="4" style="width:45px; float:left;" />
		            </div>
		            <div class="column" style="width:5%;">
		            <?php if($v->active == 'yes'){?>
		            	<a href="javascript:void(0);" onclick="status('<?php echo $v->id;?>', 'no', '<?php echo $this->lang->line('status_mess'); ?>', 'video')"><img src="<?php echo base_url();?>public/admin/img/active.png" title="<?php echo $this->lang->line('active'); ?>" alt="Yes" class="icon png" /></a>
					<?php }else{?>		            	
		            	<a href="javascript:void(0);" onclick="status('<?php echo $v->id;?>', 'yes', '<?php echo $this->lang->line('status_mess'); ?>', 'video')"><img src="<?php echo base_url();?>public/admin/img/pending.png" title="<?php echo $this->lang->line('suspend'); ?>" alt="No" class="icon png" /></a>
		            <?php }?>
		            </div>
	            </div>
	        </div>
	        <?php }?>
	        <?php }else{?>
	        	<p style="padding: 10px;font-size: 16px; font-style: italic; color: green;" ><?php echo $this->lang->line('no_results'); ?></p>
	        <?php }?>
	        <div class="bottom1">
	        	<div class="column" style="width: 2%;"><input class="check_all" onclick="check_all(this)" type="checkbox"></div>
	            <div class="column" style="width:50%;">
	            	<select style="width:130px;" name="action">
	                   	<option value=""><?php echo $this->lang->line('choose_action'); ?></option>                               
                        <option value="active"><?php echo $this->lang->line('active'); ?></option>
                        <option value="suspend"><?php echo $this->lang->line('suspend'); ?></option>
	                </select>
	                <input type="submit" name="" value="<?php echo $this->lang->line('apply'); ?>" class="btn" />
	            </div>
	            </span>
	             <span class="right1">
	                <div class="pagination">
	                	<?php if(isset($pagination)){echo $pagination;}?>
	            	</div>
	            </span>
	        </div>
        </form>
	</div>
	
<script type="text/javascript">
	function changePageNumber() {
		$("#list-video-form").submit();
	}
	var inform	=	'<?php echo $inform;?>';
	if(inform == 'delete video success') {alert("<?php echo $this->lang->line('delete_mess'); ?>");}

	function sendData(stat){
		var status	=	stat;
		$('input[name="status"]').val(status);
		$('#show_type').submit();
	}
	
	$('#action_video_form').iframer({
	    onComplete: function(msg){
	    	if(msg == 'yes') {
		    	alert('<?php echo $this->lang->line('action_mess'); ?>');
	    		window.location	=	'<?php echo $current_url;?>';
	    	}
	    	else show_error('div_message', msg)
	    }
	});

	
	$(function(){
		$('.order').keydown(function(event){
        	if ( event.keyCode == 46 || event.keyCode == 8 ) {
                // let it happen, don't do anything
            }else{
                // Ensure that it is a number and stop the keypress
                if ((event.keyCode < 48 || event.keyCode > 57) && (event.keyCode < 96 || event.keyCode > 105 )) {
                    event.preventDefault(); 
                }   
            }
			
            if(event.keyCode == 13) { // Enter pressed
            	alert("<?php echo $this->lang->line('order_mess');?>");
	            var video_order = $(this).val(); 
	            var video_id = $(this).attr('id');
	            $('input[name="video_id"]').val(video_id);
	            $('input[name="video_order"]').val(video_order);
	            $('#change_order_video').submit();
        	}
        });
	})
</script>
<?php
    echo form_open(admin_url('video/change-order'), array('id' => 'change_order_video'), array('video_id' => 0, 'video_order' => 0));
    echo form_close();
?>
<?php 
	echo form_open(admin_url('video'), array('id' => 'show_type'), array('status' => 0));
	echo form_close();
?>
	